Skip to content

Add configuration options for pre- and post-filters #1314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2025
Merged

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Jul 18, 2025

This PR adds the ability to have pre- and post-filters for the input and output jax be included in their configuration objects, rather than having to use the startup.ready() function to add them. It also adds a pre-filter to the output jax, for symmetry (and because it may be easier to do filtering there than to have to add a post-filter onto each of the input jax if there are multiple input formats).

To facilitate this, a new addList() method is added to the FunctionList object, and for good measure this is used in the TeX input jax to add its filters. You can also now pass a function list to the FunctionList constructor. A new test is added to the FunctionList tests to cover the new code.

@dpvc dpvc requested a review from zorkow July 18, 2025 18:41
@dpvc dpvc added this to the v4.0 milestone Jul 18, 2025
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A query on the comments. O/w lgtm.

@@ -47,7 +47,12 @@ export interface OutputJax<N, T, D> {
options: OptionList;

/**
* Lists of post-filters to call after typesetting the math
* Lists of pre-filters to call after typesetting the math
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a single list not a list of lists?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. The two lists used to be under one comment, but I split it for better jsdoc coverage, and neglected to fix the plural.

preFilters: FunctionList;

/**
* Lists of post-filters to call before typesetting the math
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 98.38710% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (4d1e195) to head (cc1e8e5).
⚠️ Report is 56 commits behind head on develop.

Files with missing lines Patch % Lines
ts/output/common.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1314      +/-   ##
===========================================
- Coverage    86.71%   86.71%   -0.01%     
===========================================
  Files          337      337              
  Lines        83979    84067      +88     
  Branches      4750     3129    -1621     
===========================================
+ Hits         72826    72900      +74     
- Misses       11130    11167      +37     
+ Partials        23        0      -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpvc dpvc merged commit 64a1d96 into develop Jul 28, 2025
3 checks passed
@dpvc dpvc deleted the update/filter-config branch July 28, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants